package com.guomao.demog;

import net.sf.cglib.proxy.Enhancer;

public class CglibDynamicProxyTest {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(UserService.class);
        enhancer.setCallback(new UserServiceInterceptor());
        UserService proxy = (UserService) enhancer.create();
//        proxy.addUser("Tom", "123456");

        System.out.println(proxy.getClass().getSuperclass());
    }
}